﻿/***************************************************************************************
   Date    : February 7, 2007
   Purpose : Implements the Default Page Class
   Maintenance Log : 
   Revision		Date			Description 
   --------		---------		-----------------
	1.0		    7/02/2007		Initial Release

****************************************************************************************/

using System;
using System.Diagnostics;
using System.Web.UI;

namespace Hclt.Msft.Til.CricketScoreboard
{
    /// <summary>
    /// Code Behind Class For Default Page.
    /// </summary>
    public partial class Default : System.Web.UI.Page
    {
        /// <summary>
        /// Event Handler Is Called When Default Page Is Loaded.
        /// Created ScoreSheetReader Object, Scoreboard Object To Load Correct XAML.
        /// </summary>
        /// <param name="sender">Hold The Reference To The Event Generator.</param>
        /// <param name="e">Object To Hold Various Event Data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {                
                ScoreSheetReader reader = new ScoreSheetReader();
                Scoreboard board = reader.GetScoreBoard();
                DisplayScreen.CreateScene(board);
            }
            catch (Exception ex) 
            {
               // Log The Exception Information In Trace.
               System.Diagnostics.Trace.WriteLine(string.Concat(DateTime.Now, " :: ", ex.ToString(), Environment.NewLine));
               System.Diagnostics.Debug.WriteLine(string.Concat(DateTime.Now, " :: ", ex.ToString(), Environment.NewLine));
            }
        }

    }

}